<template>
	<view style="background-color: white;">
	<view style="display: flex;background-color: white;align-items: center;padding:5px 10px;justify-content: space-between;">
		<view @click="tel(userinfo.tel)" style="display: flex;align-items: center;">
			<u-avatar :src="userinfo.avatar" size="35"></u-avatar>
			<p style="margin-left: 5px;color: #868686;display: flex;align-items: center;">{{userinfo.nickname}}<u-icon v-if="userinfo.vip>new Date().getTime()" name="/static/other/vip.png" style="margin-left: 3px;" size="18" /></p>
		</view>
		<p style="display: flex;align-items: center;font-size: 13px;" @click="report(data._id,data.title)">举报</p>
	</view>
	<view style="text-align: center;margin-top: 40px;">
		<image :src="data.icon" style="width: 80px;height: 80px;border-radius: 10px;"></image>
		<p style="font-size: 20px;margin-top: 5px;">{{data.title}}</p>
		<p style="margin-top: 5px;font-size: 14px;color: #868686;">{{data.version}}</p>
		<view @click="down(data._id)" style="background-color: #33c4fd;color: white;padding: 12px;border-radius: 7px;font-size: 16px;margin: 20px 100px;">
			下载（{{data.size}}）
		</view>
		<view v-if="data.content!=null&&data.content!=''" style="background-color: #fff6e4;padding: 5px;color: #7b7458;margin: 10px 20px;border-radius: 7px;font-size: 14px;text-align: left;">
			<rich-text selectable :nodes="data.content"></rich-text>
		</view>
		<!-- apk广告 -->
		<ad adpid="1402622050"></ad>
		<image @click="openImg(data.image,index)" v-for="(item,index) in data.image" :src="item" mode="widthFix" style="border-radius: 10px;margin-top: 10px;"></image>
<websitenav></websitenav>
	</view>	
	</view>
</template>
<script>
		const db = uniCloud.database();
		import ase from '@/common/ar-aes/ar-aes.js'
	export default {
		props: {
			data: {
				type: Object,
				default (data) {
					return {}
				}
			}
		},
		name:"apl_moren",
		data(){
			return{
				userinfo:{
					avatar:null,
					nickname:null,
					tel:null
				}
			}
		},
		mounted() {
		this.getuserinfo(this.data.user_id)
		},
		methods:{
			async getuserinfo(id){
				const res=await db.collection("uni-id-users").where({_id:id}).field("nickname,avatar,tel,vip").get()
					this.userinfo=res.result.data[0]
			},
			tel(tel){
				if(tel==null){
					return null
				}
				uni.showModal({
					title: '联系方式',
					content: tel
				});
			},
			report(id,title){
				uni.navigateTo({
					url: '../feedback/feedback?id='+id+'&type=file'
				});
			},
	down(id){
		this.$emit("down",{id:id})
	}
		}
	}
</script>

<style lang="less">
body{
	background-color: white;
}
</style>